<!DOCTYPE html>
<html>
<head>
	
	<title><?php echo _MANAGER_TITLE_; ?></title>

	<?php $this->setFlag('list,vue'); ?>
	<?php $this->import('meta'); ?>

	<link rel="stylesheet" type="text/css" href="html/manager/account/css/user.css" />

    <script type="text/javascript" src="html/manager/account/js/user.js?v=10"></script>

</head>
<body>

	<div id="mainBg" class="bg" style="display: none;">

		<input type="text" id="flag" class="display-none" />

		<div class="title-bar">
            <div class="title">用户管理</div>
            <button type="button" class="layui-btn btnAdd" onclick="addUser()">添加新用户</button>
        </div>

        <div class="query-bar">
            <div class="search-left">
                <select id="isuse" class="ddlist" onchange="queryKey('ddl')">
                    <option value="" selected="selected">全部状态</option>
                    <option value="1" >启用</option>
                    <option value="0" >关闭</option>
                </select>
            </div>
            <div class="search-right">
                <input type="text" id="keyword" class="keyword" placeholder="请输入用户姓名" autocomplete="off" />
                <button type="button" class="btnOk" onclick="queryKey('ok')">确定</button>
            </div>
        </div>

        <div class="tongji-bar">
            <span class="tongji">共<span id="listCount" class="tc1"></span>个用户</span>
        </div>

        <div id="listBar" class="table-bar">
        	<table class="table-box">
        		<tr class="tr-head">
                    <td class="td-head hw1">编号</td>
                    <td class="td-head">用户ID</td>
                    <td class="td-head hw5">姓名</td>
                    <td class="td-head hw5">账号</td>
                    <td class="td-head hw4">角色</td>
                    <td class="td-head hw4">最新登录时间</td>
                    <td class="td-head hw1">状态</td>
                    <td class="td-head hw6">操作</td>
                </tr>
                <tr class="tr-item" v-for="user in list">
                	<td class="td-item-center hw1">{{ user.id }}</td>
                    <td class="td-item-center">{{ user.userid }}</td>
                    <td class="td-item-center hw5">{{ user.name }}</td>
                    <td class="td-item-center hw5">{{ user.username }}</td>
                    <td class="td-item-center hw4">{{ user.role }}</td>
                    <td class="td-item-center hw4">{{ user.logintime }}</td>
                    <td class="td-item-center hw1">
                    	<template v-if="user.isuse == 1">
                    		启用
                    	</template>
                    	<template v-else-if="user.isuse == 0">
				            <span class="tc1">关闭</span>
				        </template>
				        <template v-else>
				            状态有误
				        </template>
                    </td>
                    <td class="td-item-center hw6">
                        <span class="item-edit" v-on:click="editUser(user.userid)">编辑</span>
                        <span class="item-delete r11" v-on:click="editRole(user.userid, user.name)">修改权限</span>
                        <span class="item-delete r11" v-on:click="resetUsername(user.userid, user.name)">重置账号</span>
                        <span class="item-delete" v-on:click="resetPassword(user.userid, user.name)">重置密码</span>
                    </td>
                </tr>
        	</table>
        </div>

        <script type="text/javascript">
        	var userList = new Vue({
	            el: '#listBar',
	            data: {
	                list: ''
	            }
	        });
        </script>



        <div id="writeBar" style="display: none;">
        	<div class="write-bar">
        		<div id="writeTitle" class="write-title">添加新用户</div>
        		<div class="write-content">
        			<div class="write-tr1">
                        <div class="write-field1">姓名：</div>
                        <div class="write-value1">
                            <input type="text" id="usermc" class="write-input1" placeholder="请输入姓名" autocomplete="off" />
                        </div>
                    </div>
                    <div class="write-tr1">
                        <div class="write-field1">账号：</div>
                        <div class="write-value1">
                            <input type="text" id="username" class="write-input1" placeholder="请输入账号" autocomplete="off" />
                        </div>
                    </div>
                    <div class="write-tr1">
                        <div class="write-field1">状态：</div>
                        <div class="write-value1">
                            <input type="radio" name="userstatus" class="write-chenk1" checked="checked" value="1" />启用
                            <input type="radio" name="userstatus" class="write-chenk2" value="0" />关闭
                        </div>
                    </div>
        		</div>
        		<div class="write-button">
                    <div class="write-button-ok" onclick="saveUserInfo()">确定</div>
                    <div class="write-button-cancel" onclick="closeWriteDiv()">取消</div>
                </div>
        	</div>
        </div>
        <input type="text" id="tempid" class="display-none" />



        <div id="writeBar2" style="display: none;">
            <div class="write-bar">
                <div id="writeTitle2" class="write-title">设置角色权限</div>
                <div class="write-content">
                    <div class="write-tr1">
                        <div class="write-field1">角色类型：</div>
                        <div class="write-value1">
                            <select id="roletype" class="write-select1" onchange="getRoleOfType()">
                                <option value="">请选择</option>
                                <option value="0">管理岗</option>
                                <option value="1">运营岗</option>
                                <option value="2">研发岗</option>
                                <option value="3">试用岗</option>
                            </select>
                        </div>
                    </div>
                    <div class="write-tr1">
                        <div class="write-field1">角色名称：</div>
                        <div class="write-value1">
                            <select id="roleid" class="write-select1">
                                <option value="">请选择</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="write-button">
                    <div class="write-button-ok" onclick="saveRoleInfo()">确定</div>
                    <div class="write-button-cancel" onclick="closeWriteDiv2()">取消</div>
                </div>
            </div>
        </div>
        <input type="text" id="tempid2" class="display-none" />



        <div id="writeBar3" style="display: none;">
            <div class="write-bar">
                <div id="writeTitle3" class="write-title">重置密码</div>
                <div class="write-content">
                    <div class="write-tr1">
                        <div class="write-field1">新密码：</div>
                        <div class="write-value1">
                            <input type="text" id="password" class="write-input1" placeholder="请输入新密码" autocomplete="off" />
                        </div>
                    </div>
                </div>
                <div class="write-button">
                    <div class="write-button-ok" onclick="savePasswordInfo()">确定</div>
                    <div class="write-button-cancel" onclick="closeWriteDiv3()">取消</div>
                </div>
            </div>
        </div>
        <input type="text" id="tempid3" class="display-none" />
        
	</div>

</body>
</html>